package com.fusuhai05;

public class Zoo {
    public static void main(String[] args) {
        Animal[] animals = new Animal[4];
        Cat cat1 = new Cat();
        Cat cat2 = new Cat();
        Dog dog1 = new Dog();
        Dog dog2 = new Dog();
        animals[0] = cat1;
        animals[1] = cat2;
        animals[2] = dog1;
        animals[3] = dog2;
        Feeder feeder = new Feeder();
        for (int i = 0; i < animals.length; i++) {
            feeder.feed(animals[i]);
        }
    }
}